import http from '@/utils/http/axios';

enum Api {
  login = '/sysUser/login',
  dept = '/relLoginDept',
  menuList = '/sysMenu/list',
  analysis = '/sysMenu/listAnalysis',
  staticMenu = '/api/menu.json',
  allMenu = '/sysMenu/findAll'
}

/**
 * @description: 获取指标菜单
 */
export function getStaticMenus() {
  return http.request(
    {
      url: Api.staticMenu,
      method: 'GET'
    },
    {
      isTransformRequestResult: false
    }
  );
}
/**
 * @description: 获取指标菜单
 */
export function getAnalysisMenus() {
  return http.request(
    {
      url: Api.analysis,
      method: 'GET'
    },
    {
      isTransformRequestResult: false
    }
  );
}

/**
 * @description: 获取全部菜单
 */
export function getAllMenus() {
  return http.request(
    {
      url: Api.menuList,
      method: 'GET'
    },
    {
      isTransformRequestResult: false
    }
  );
}

/**
 *  登录
 * @param params
 * @returns
 */
export function login(est) {
  return http.request(
    {
      url: `${Api.login}?est=${est}`,
      method: 'GET'
    },
    {
      isTransformRequestResult: false,
      isParseToJson: true
    }
  );
}
